package com.hksj.Intelligentmanagement.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hksj.Intelligentmanagement.dto.AurgicalAssistantRelationDTO;
import com.hksj.Intelligentmanagement.entity.AurgicalAssistantRelationEntity;
import com.hksj.Intelligentmanagement.mapper.SurgicalAssistantRelationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName SurgicalAssistantRelationService
 * @Description TODO
 * @Author @陈章
 * @Date 2023/3/31 17:16
 * @Version 1.0
 */
@Service
public class SurgicalAssistantRelationService extends ServiceImpl<SurgicalAssistantRelationMapper, AurgicalAssistantRelationEntity> {
    @Autowired
    private SurgicalAssistantRelationMapper surgicalAssistantRelationMapper;


    public void addSurgicalAssistantRelation(String operatingRoomInfoId, List<AurgicalAssistantRelationDTO> param) {
        List<AurgicalAssistantRelationDTO> list= param;
        List<AurgicalAssistantRelationEntity> entityList = JSONObject.parseArray(JSONObject.toJSONString(list), AurgicalAssistantRelationEntity.class);

        surgicalAssistantRelationMapper.addSurgicalAssistantRelation(operatingRoomInfoId, entityList);
    }
}
